<include file="public@head" />
</head>

<body>
    <div class="layui-fluid wrap js-check-wrap" id="component-tabs">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">插件列表</div>
                    <div class="layui-card-body">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li class="layui-this"><a href="{:url('plugin/index')}">{:lang('ADMIN_PLUGIN_INDEX')}</a></li>
                                <li><a href="http://www.thinkcmf.com/appstore/plugin.html" target="_blank">插件市场</a></li>
                                <li><a href="http://www.thinkcmf.com/faq.html?url=https://www.kancloud.cn/thinkcmf/faq/493510" target="_blank">插件安装<i class="fa fa-question-circle"></i></a>
                                </li>
                                <li><a href="http://www.thinkcmf.com/topic/index/index/cat/9.html" target="_blank">插件交流</a></li>
                                <li><a href="https://www.kancloud.cn/thinkcmf/doc/266542" target="_blank">插件文档</a></li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <form action="" method="post" class="js-ajax-form layui-form">
                                        <php>
                                            $status=array("1"=>'开启',"0"=>'禁用',"3"=>'未安装');
                                        </php>
                                        <table class="layui-table">
                                            <thead>
                                                <tr>
                                                    <th>插件名称</th>
                                                    <th>插件标识</th>
                                                    <th>描述</th>
                                                    <th>作者</th>
                                                    <th width="60">状态</th>
                                                    <th width="210">操作</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <foreach name="plugins" item="vo">
                                                    <tr>
                                                        <td>{$vo.title}</td>
                                                        <td>{$vo.name}</td>
                                                        <td>{$vo.description}</td>
                                                        <td>{$vo.author}</td>
                                                        <td><span class="layui-btn layui-btn-xs layui-btn-warm">{$status[$vo['status']]}</span></td>
                                                        <td>
                                                            <span class="layui-btn-group">
                                                                <if condition="$vo['status']==3">
                                                                    <a href="{:url('plugin/install',array('name'=>$vo['name']))}" class="js-ajax-dialog-btn layui-btn layui-btn-xs" data-msg="确定安装该插件吗？">安装</a>
                                                                    <else />
                                                                    <php>$config=json_decode($vo['config'],true);</php>
                                                                    <if condition="!empty($config)">
                                                                        <empty name="config.custom_config">
                                                                            <a class="layui-btn layui-btn-xs" href="{:url('plugin/setting',array('id'=>$vo['id']))}">设置</a>
                                                                            <else />
                                                                            <a class="layui-btn layui-btn-xs" href="{:cmf_plugin_url($vo['name'].'://AdminIndex/setting')}">设置</a>
                                                                        </empty>
                                                                        <else />
                                                                        <a class="layui-btn layui-btn-xs layui-disabled" href="javascript:;">设置</a>
                                                                    </if>
                                                                    <if condition="!empty($vo['has_admin'])">
                                                                        <a class="layui-btn layui-btn-xs" lay-href="{:cmf_plugin_url($vo['name'].'://AdminIndex/index')}" title="plugin_{$vo.name}" lay-text="{$vo.title}">管理</a>
                                                                        <else />
                                                                        <a class="layui-btn layui-btn-xs layui-disabled" href="javascript:;">管理</a>
                                                                    </if>
                                                                    <a href="{:url('plugin/update',array('name'=>$vo['name']))}" class="layui-btn layui-btn-xs js-ajax-dialog-btn" data-msg="确定更新该插件吗？">更新</a>
                                                                    <if condition="$vo['status']==0">
                                                                        <a href="{:url('plugin/toggle',array('id'=>$vo['id'],'enable'=>1))}" class="layui-btn layui-btn-xs layui-btn-normal js-ajax-dialog-btn" data-msg="确定启用该插件吗？">启用</a>
                                                                        <else />
                                                                        <a href="{:url('plugin/toggle',array('id'=>$vo['id'],'disable'=>1))}" class="layui-btn layui-btn-xs layui-btn-normal js-ajax-dialog-btn" data-msg="确定禁用该插件吗？">禁用</a>
                                                                    </if>
                                                                    <a href="{:url('plugin/uninstall',array('id'=>$vo['id']))}" class="layui-btn layui-btn-xs layui-btn-danger js-ajax-dialog-btn" data-msg="确定卸载该插件吗？">卸载</a>
                                                                </if>
                                                            </span>
                                                        </td>
                                                    </tr>
                                                </foreach>
                                            </tbody>
                                        </table>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <include file="public@footer" />
</body>

</html>